import { createRouter, createWebHistory } from 'vue-router'
import homepage from '@/views/homepage.vue'
import clogin from '@/views/clogin.vue'
import plogin from '@/views/plogin.vue'
import myself from '@/views/myself.vue'
import reg from '@/views/reg.vue'
import changepassword from '@/views/changepassword.vue'
import tag from '@/views/tag.vue'
import text from '@/views/text.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: homepage
    },
    {
      path: '/',
      name: 'clogin',
      component: clogin
    },
    {
      path: '/plogin',
      name: 'plogin',
      component: plogin
    },
    {
      path: '/myself',
      name: 'myself',
      component: myself,
      children: [
        {
          path: 'cate',
          name: 'cate',
          component: () => import('@/views/cate.vue')
        }
      ]
    }
    ,
    {
      path: '/changepassword',
      name: 'changepassword',
      component: changepassword
    },
    {
      path: '/reg',
      name: 'reg',
      component: reg
    },
    {
      path: '/tag',
      name: 'tag',
      component: tag
    },
    {
      path: '/text',
      name: 'text',
      component: text
    }
  ],
})

export default router
